package API.Map.TreeMap;

import java.util.Comparator;
import java.util.TreeMap;

public class ListByOverrideTree {
    public static void main(String[] args) {
        Student student1 = new Student("John", 22);
        Student student2 = new Student("Jane", 21);
        Student student3 = new Student("Nick", 22);
        TreeMap<Student, String> map = new TreeMap<>();
        map.put(student1, "John");
        map.put(student2, "Jane");
        map.put(student3, "Nick");
        System.out.println(map);
    }
}
